Skip to content

chore: Enhance Digester test coverage with edge case scenarios#1796

Merged
matheuscscp merged 4 commits into
fluxcd:mainfrom
zhaque44:test-with-index
May 9, 2025
Merged

chore: Enhance Digester test coverage with edge case scenarios#1796
matheuscscp merged 4 commits into
fluxcd:mainfrom
zhaque44:test-with-index

Conversation

@zhaque44
Copy link
Copy Markdown
Contributor

@zhaque44 zhaque44 commented May 8, 2025

This PR enhances the test coverage for the index.Digester by adding the following test scenarios:

  • Ensures WithIndex correctly handles a nil input.
  • Verifies that multiple WithIndex options are processed, with the last one applied.
  • Confirms that Digester.Add can handle empty keys and values.
  • Ensures Digester.Delete gracefully handles the deletion of non-existent keys.
  • Verifies that Digester.Index returns an empty copy for an empty internal index.
  • Checks that the Len method returns 0 for a new, empty Digester.
  • Verifies that the String method returns an empty string for an empty Digester.

zhaque44 added 4 commits May 8, 2025 18:54
Signed-off-by: zhaque44 <haque.zubair@gmail.com>
Signed-off-by: zhaque44 <haque.zubair@gmail.com>
Signed-off-by: zhaque44 <haque.zubair@gmail.com>
Signed-off-by: zhaque44 <haque.zubair@gmail.com>
Copy link
Copy Markdown
Member

@matheuscscp matheuscscp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @zhaque44! 👌

@matheuscscp matheuscscp merged commit 0058004 into fluxcd:main May 9, 2025
8 checks passed
@zhaque44
Copy link
Copy Markdown
Contributor Author

zhaque44 commented May 9, 2025

@matheuscscp it has been amazing working with you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants